//
//  UIImageView+Extension.h
//  TaduUtils
//
//  Created by Deheng Xu on 11-8-6.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#if TARGET_OS_IPHONE

#import <UIKit/UIKit.h>

@class XWebImageView;

@protocol XWebImageViewDownloadDelegate <NSObject>

@optional
- (void)webImage:(XWebImageView *) xWebImageView downloaded:(NSData *)imageData;

@end

@interface XWebImageView : UIImageView {
    UIImage * image;
}

@property (nonatomic, retain) NSString * defaultIconName;
@property (nonatomic, retain) NSURLConnection * connection;
@property (nonatomic, retain) NSString * imageUrl;
@property (nonatomic, retain) NSMutableData * data;

@property (nonatomic, retain) UIActivityIndicatorView * activity;
@property (nonatomic, assign) id <XWebImageViewDownloadDelegate> delegate;
@property (nonatomic) BOOL isNeedDecompress;
@property (nonatomic, retain) NSString * imageType;

- (id)initWithDefaultImageName:(NSString*)imageName;
- (void)updateImage:(BOOL) force;
- (void)startDownloading:(NSString *) sUrl;
- (void)stopDownloading;
- (void)resetImage;

@end

#endif
